Curve: Developing an Apparatus

Note: This is the stripped version of Curve.  Apparati cannot be dynamically loaded.  If you would like a version which allows you to load an apparatus which you programmed, contact Michael Rogers at mkr@cs.amherst.edu

The apparati listed under the apparatus menu after they are loaded.  In order to produce a curve using an apparatus, drag the gray triangle point P with the mouse.  This will cause another black round point to move (among other points).  This point is usually unlabeled or labeled with an  X.  As it moves, it traces out a curve.

This will hopefully give you an idea of how to program your own appartus which can be dynamically loaded into Curve with the Load Apparatus menu command.  First you should see the help file for a general description of how apparati are supposed to operate.  There are also descriptions of the CurveApparatus and AnalyticApparatus classes used to implement apparati as well as descriptions of the Inspector and AnalyticInspector classes used to implement inspectors.

An apparatus must be a subclass of CurveApparatus.  There are just a few things that you must program:
	(i)	Initialize your apparatus.  This is perhaps obvious.
	(ii)	Draw the apparatus.  This is divided into two parts.  You must provide methods to draw the parts which move when the ``variable'' point P is dragged, and you must draw the parts which do not move.  When P is dragged, only the moving parts are redrawn.
	(iii)	Calculate new positions.  When P is dragged, your apparatus is sent a message to recalculate the positions of the affected parts.
	(iv)	Respond to changes in parameters.  Often an apparatus will have other points which can be dragged.  The positions of these points will affect the shape of the curve.  They are called parameter points.  When one is dragged, the apparatus is sent a message.
You might want an inspector.  Then you would have an additional responsibilty to program.
	(v)	Interact with its inspector.  An inspector is optional except for subclasses of AnalyticApparatus.  These apparati require equations which must be input via an inspector. Even here, much of the burden of programming an inspector is assumed by the AnalyticInspector class and its NIB file.

Apparati can also be linked to help files, files containing preset examples for the user to select, inspectors (of course),  and any other auxiliary files you might wish to include.  These are bundled together in a file package (a directory with a .capp extension) containing the files.

The Lemniscate class is simple example of a synthetic apparatus.  The Parabola class is also simple but shows how to include a Help file.  In some ways, subclassing AnalyticApparatus is easier because there is much functionality already programmed into it.  The Function class is a simple example.

Program Structure

(TO BE FILLED IN LATER.) 

Program Dynamics

(TO BE FILLED IN LATER.) 

Synthetic Apparati

In synthetic apparati, the curve is usually determined by its relation to other points in the plane.  Some of these points, usually black round ones, can be dragged to new locations.  This will determine a new curve.  Some of the points, usually gray round ones, are determined by the black round ones.  They cannot be dragged.  Often they move when  P  does.

The basic idea behind a synthetic appratus is that the relation between the point  X  on the curve and the point  P  is shown by lines, circles, etc. connecting the points.
By moving  P  and by careful observation, one sees in the changing lines, circles, etc. how the curve is constructed.
This idea is based on what is called a `linkage.'  A linkage is an apparatus consisting of rods linked together in various ways.  At a connection of two rods, the rods may be free to rotate, one may be able to slide, or perhaps both can slide. (See Yates, Curves and Their Properties, The National Council of Teachers of Mathematics, for pictures of linkages.)  Another kind of synthetic apparatus is the familiar toy Spirograph.  In this kind of apparatus, circles roll on circles.

Some of the apparati have Inspectors.  These inspectors allow for a more analytic output and/or input.  They might display the coordinates of points and allow them to be altered.  Other properties of the curve might be displayed such as its equation.

Analytic Apparati

In analytic apparati, the curve is usually determined by an algebraic formula for a function.  These apparati require the use of the Inspector and usually display it automatically.  The function(s) may be entered through the Inspector.  Three different ways of describing a curve are now used.  One may enter it as either (1) a function of  the x coordinate of  P, (2) in polar form as a function of the angle t of the segment from the origin to a point  P and the positive x-axis, or (3) by parametrizing the x and y coordinates as functions of an independent variable t.   The value of   t  is determined by a parametrizer supplied by the apparatus.  This is often a line segment representing an interval of  t  values. Other common features usually include being able to set the coordinates of the intersection of cross-hairs called the origin or mid-point of the window and the scaling factor.

Inspectors

(TO BE FILLED IN LATER.) 

Help Files

Some apparati have their own specific help messages.  These are text files located in the file package directory.  They are automatically loaded when the user asks for help.  You need only write such a file.  Ideally this file should contain both instructions on how to operate the apparatus as well as a historical note or other material explaining the interest of the curve.